package com.meilingcloud.biobank.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 样本预警 对象 bank_sample_alarm
 *
 * @author chenl
 * @date 2021-05-26
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("bank_sample_alarm")
public class SampleAlarm implements Serializable {

    private static final long serialVersionUID = 1L;


    /**
     * 样本预警ID
     */
    @TableId(value = "samp_alarm_id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampAlarmId;

    /**
     * 样本复份ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampBackupId;

    /**
     * 样本类型ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long sampTypeId;

    /**
     * 预警类型
     */
    private String sampAlarmType;

    /**
     * 预警内容
     */
    private String sampAlarmContent;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 样本复份编号
     */
    @TableField(exist = false)
    private String sampBackupCode;

    /**
     * 样本源名称
     */
    @TableField(exist = false)
    private String sampSourceName;

    /**
     * 样本类型名称
     */
    @TableField(exist = false)
    private String sampTypeName;

    /**
     * 样本状态
     */
    @TableField(exist = false)
    private String sampState;

    /**
     * 格式化位置
     */
    @TableField(exist = false)
    private String sampLocation;

    /**
     * 冻融次数
     */
    @TableField(exist = false)
    private Integer sampFreezeThawCount;

    /**
     * 条码/二维码
     */
    @TableField(exist = false)
    private String qrCode;

    /**
     * 采样时间
     */
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date samplingTime;

    /**
     * 保质天数
     */
    @TableField(exist = false)
    private Integer sampTypeShelfLife;

    /**
     * 低使用率年限
     */
    @TableField(exist = false)
    private BigDecimal sampTypeLowUseYear;

    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();
}
